package com.conncui.subscript;


import com.conncui.subscript.fragment.V2SubscriptFragment;
import com.conncui.subscript.viewpager.ShowFragmentPagerAdapter;

import android.app.Activity;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.PersistableBundle;


import android.support.v4.view.PagerAdapter;
import androidx.viewpager2.widget.ViewPager2;
import android.util.SparseArray;
import android.view.Menu;
import butterknife.BindView;
import butterknife.ButterKnife;

public class OverLayActivity extends FragmentActivity {
    final String TAG;
    SparseArray<Fragment> mFragmentSparseArray;
    PagerAdapter mPagerAdapter;
    ShowFragmentPagerAdapter mShowFragmentPagerAdapter;
    @BindView(R.id.subscript_vp)
    ViewPager mSubscriptVp;

    public OverLayActivity() {
        this.TAG = getClass().getSimpleName();
    }

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_subscript);
        ButterKnife.bind((Activity) this);
        this.mShowFragmentPagerAdapter = new ShowFragmentPagerAdapter(getSupportFragmentManager());
        this.mFragmentSparseArray = new SparseArray();
        V2SubscriptFragment v2SubscriptFragment = new V2SubscriptFragment();
        this.mFragmentSparseArray.put(0, v2SubscriptFragment);
        this.mShowFragmentPagerAdapter.setViewSparseArray(this.mFragmentSparseArray);
        this.mSubscriptVp.setAdapter(this.mShowFragmentPagerAdapter);
    }

    protected void onStart() {
        super.onStart();
    }

    protected void onRestart() {
        super.onRestart();
    }

    protected void onResume() {
        super.onResume();
    }

    protected void onPause() {
        super.onPause();
    }

    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
    }

    public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
        super.onSaveInstanceState(outState, outPersistentState);
    }

    protected void onStop() {
        super.onStop();
    }

    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    }

    public void onBackPressed() {
        super.onBackPressed();
    }

    protected void onDestroy() {
        super.onDestroy();
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.list_delete, menu);
        return super.onCreateOptionsMenu(menu);
    }

    public boolean onCreatePanelMenu(int featureId, Menu menu) {
        return super.onCreatePanelMenu(featureId, menu);
    }

    public PagerAdapter getPagerAdapter() {
        return this.mPagerAdapter;
    }
}
